package is.glif.fenius.webui.db;


import java.util.List;

import is.glif.fenius.webui.db.bean.WebReserveRequest;

import org.hibernate.Session;

public class WebReserveRequestDAO {
    
    private void create(WebReserveRequest req) {
        Session session = HibernateSessionUtil.getSessionfactory().openSession(); 
        session.getTransaction().begin(); 
        session.save(req);
        session.getTransaction().commit(); 
        session.close();

    }
    
    @SuppressWarnings("unchecked")
    public List<WebReserveRequest> findAll() { 
        Session session = HibernateSessionUtil.getSessionfactory().openSession(); 
        List<WebReserveRequest> list = (List<WebReserveRequest>) session.createQuery("From WebReserveRequest").list(); 
        
        return list;
    }
    
}
